<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>字面量</title>
</head>
<body>

<h2>文字字面量，用单引号'...'的字符串就是文字字面量</h2>
<!--<a th:href="${'/user/detail?sex='+${sex}}">查看性别</a>-->
<span th:text="Hello"></span>

<h2>数字字面量</h2>
今年是<span th:text="2020">1949</span>年<br>
20年后是<span th:text="2020+20">1949</span>年<br>
</body>

<h2>boolean字面量</h2>
<div th:if="${flag}">
    执行成功
</div>
<div th:if="${!flag}">
    执行不成功
</div>

<h2>null字面量（空值字面量）</h2>
<span th:text="${user01.id}"></span>
<div th:unless="${user02 eq null}">
    user02用户已创建
</div>
<!--这里如果直接取user02.id的值会报错-->
<div th:if="${user02.id eq null}">
    user02用户编号为空
</div>
<div th:if="${user02.username eq null}">
    user02用户姓名为空
</div>
</html>